package com.maslyk.job;

import org.apache.log4j.Logger;

import com.maslyk.invitation.service.email.EmailProcessingService;

/**
 *
 * @author kris
 */
public final class AutomaticJob
{    
	private Logger log = Logger.getLogger(AutomaticJob.class);
	
	private EmailProcessingService emailProcessingService;
	
	/**
     przetwarzanie emaili
     */
    public void emailProcessing() throws Exception
    {
    	log.info("Przetwarzanie emaili z komentarzami start...");
    	emailProcessingService.orderEmailProcess();
    }

	public void execute()
	{
		try 
		{
			emailProcessing();
		}
		catch (Exception e) 
		{
			log.error(e,e);
		}
	}

	public void setEmailProcessingService(EmailProcessingService emailProcessingService) {
		this.emailProcessingService = emailProcessingService;
	}
}
